// MainWindow.cs created with MonoDevelop
// User: andreas at 03:56 22.05.2009
//
// To change standard headers go to Edit->Preferences->Coding->Standard Headers
//
using System;
using Gtk;
using Mono.Posix;
using new_csharptest;
public partial class MainWindow: Gtk.Window
{	
	public MainWindow (): base (Gtk.WindowType.Toplevel)
	{
		Build ();
		source_view sv = new source_view();
		for(int i = 0; i !=sv.indexOf_languages.Length ; i+= 1 )
		{
			combobox2.AppendText(sv.get_string_ofindex(i));
		}
	}
	
	protected void OnDeleteEvent (object sender, DeleteEventArgs a)
	{
		Application.Quit ();
		a.RetVal = true;
	}

	protected virtual void OnButton7Clicked (object sender, System.EventArgs e)
	{
		Application.Quit();
	//	MessageDialog(MainWindow,DialogFlags.DestroyWithParent,MessageType.Info,ButtonsType.YesNo,"Do yu really want to save this file?");
		
	}
	

	protected virtual void OnFilechooserbutton1SelectionChanged (object sender, System.EventArgs e)
	{
		System.IO.StreamReader sr;
        sr = System.IO.File.OpenText(filechooserbutton1.Filename);
		textview1.Buffer.Text = sr.ReadToEnd();
        sr.Close();	
	}

	protected virtual void OnButton8Clicked (object sender, System.EventArgs e)
	{
		Application.Quit();
	}

	protected virtual void OnCombobox2Changed (object sender, System.EventArgs e)
	{
		source_view sv = new source_view();
		sv.change_highlighting(sv.get_indexof_lang(combobox2.ActiveText),textview1);
	}
	






	
//		source_view sv = new source_view();
//		for(int i = 0; i !=sv.indexOf_languages.Length ; i+= 1 )
//		{
//			combobox2.AppendText(sv.get_string_ofindex(i));
//		}
}